package sz.szsmk.citizencard.ui.dzsmkavtivity;

import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.text.TextUtils;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.bigkoo.pickerview.builder.TimePickerBuilder;
import com.bigkoo.pickerview.listener.OnTimeSelectListener;
import com.bigkoo.pickerview.view.TimePickerView;
import com.chenenyu.router.annotation.Route;
import com.google.android.material.bottomsheet.BottomSheetDialog;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

import javax.inject.Inject;

import sz.szsmk.citizencard.R;
import sz.szsmk.citizencard.dialog.ChooseCardDialog;
import sz.szsmk.citizencard.model.network.bean.response.AdvertisementsRes;
import sz.szsmk.citizencard.model.network.dzbean.res.AuthenticationResp;
import sz.szsmk.citizencard.model.network.dzbean.res.Bank;
import sz.szsmk.citizencard.model.network.dzbean.res.BaseRes;
import sz.szsmk.citizencard.model.network.dzbean.res.GetJobRes;
import sz.szsmk.citizencard.model.network.dzbean.res.GetPeopleRes;
import sz.szsmk.citizencard.model.network.dzbean.res.GetUserInfoRes;
import sz.szsmk.citizencard.model.network.dzbean.res.MessageEvent;
import sz.szsmk.citizencard.model.network.dzbean.res.PreAuthResult;
import sz.szsmk.citizencard.mvp.BasePresenter;
import sz.szsmk.citizencard.mvp.PersonInfoQueryMvpView;
import sz.szsmk.citizencard.mvp.RealNameAuthenticationMvpView;
import sz.szsmk.citizencard.mvp.dzsmkpresenter.RealNameAuthenticationPresenter;
import sz.szsmk.citizencard.mvp.dzsmkpresenter.RealPresenter;
import sz.szsmk.citizencard.ui.fragment.CantCloseDialog;
import sz.szsmk.citizencard.util.ACache;
import sz.szsmk.citizencard.util.Constant;
import sz.szsmk.citizencard.util.PubUtils;
import sz.szsmk.citizencard.util.SmsTimer;
import sz.szsmk.citizencard.util.StatusBarUtil;
import sz.szsmk.citizencard.util.StringUtils;
import sz.szsmk.citizencard.widget.GlobalVariables;

/**
 * @author SeaPeak
 */
@Route("appendrealname")
public class AppendRealNameInfoActivity extends AppStatusBarBaseActivity implements RealNameAuthenticationMvpView, PersonInfoQueryMvpView, View.OnClickListener {
    public static AppendRealNameInfoActivity instance;
    public static final int SHOW_LIST_PEOPLE = 0x11;
    public static final int SHOW_LIST_JOB = 0x12;

    EditText tv_qr_name;
    EditText tv_qr_id;

    EditText et_qr_phone_number;

    TextView create_card_time;
    TextView destroy_card_time;

    TextView mingzuTxt;
    TextView jobTxt;

    EditText address;

    EditText et_qr_phone_pin;
    TextView tv_qr_get_pin;


    @Inject
    RealNameAuthenticationPresenter realNameAuthenticationPresenter;
    @Inject
    RealPresenter realPresenter;

    String trustBankName;
    String bindBankName;
    String bindBankCardId;
    LinearLayout createLl;
    LinearLayout destroyLl;
    LinearLayout minzuLl;
    LinearLayout jobLl;
    RelativeLayout nameRl;
    RelativeLayout idRl;

    private int type;
    private String name;
    private String iccard;
    private String bankCode;
    private SmsTimer smsTimer;
    private BottomSheetDialog itemListDialog;

    private Dialog dialog;
    private View inflate;
    private TextView getPhoneCamera;
    private TextView getPhoneAlbnm;
    private List<GetPeopleRes.DataBean> peopleList = new ArrayList<>();
    private GetPeopleRes.DataBean currentPeople;
    private List<GetJobRes.DataBean> jobList = new ArrayList<>();
    private GetJobRes.DataBean currentJob;
    private String userCardId;
    private String jobCode = "";
    private String peopleCode = "";
    private int j;
    private String bankPhone;
    private String idCard;
    private String idName;
    //    private OptionsPickerView pvOptions;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        instance = this;
        getComponent().inject(this);
        setContentView(R.layout.activity_append_real_name_info);

        initView();
        tv_qr_get_pin.setOnClickListener(this::onClickView);
        findViewById(R.id.tv_qr_bind).setOnClickListener(this::onClickView);

        idCard = Constant.USER_IDCARD;
        idName = Constant.USER_NAME;
        StatusBarUtil.setImmersiveStatusBar(this, true);
        StatusBarUtil.setStatusBarColor(this, Color.WHITE);

        if (Constant.isRealOpen) {
            //从实名认证入口进 姓名身份证号不可编辑
            tv_qr_name.setText(idName);
            tv_qr_id.setText(idCard);
            nameRl.setBackgroundColor(getResources().getColor(R.color.color_f4f4f4));
            idRl.setBackgroundColor(getResources().getColor(R.color.color_f4f4f4));
            tv_qr_name.setEnabled(false);
            tv_qr_name.setFocusable(false);
            tv_qr_name.setKeyListener(null);//重点
            tv_qr_id.setEnabled(false);
            tv_qr_id.setFocusable(false);
            tv_qr_id.setKeyListener(null);//重点
        }

        if (type == 1) {
            realPresenter.getPersonInfo();
        } else if (type == 0) {
//            tv_qr_name.setText(name + "");
//            tv_qr_id.setText(iccard + "");
        }

        smsTimer = new SmsTimer(60000, 1000, tv_qr_get_pin);
        createLl.setOnClickListener(this);
        destroyLl.setOnClickListener(this);
        jobLl.setOnClickListener(this);
        minzuLl.setOnClickListener(this);
    }



    @Override
    public void onGainPersonInfo(GetUserInfoRes user) {
        tv_qr_name.setText(user.getData().getRealName());
        tv_qr_id.setText(user.getData().getIdCardNumber());
    }

    @Override
    public void getAdvertisementsResult(AdvertisementsRes advertisementsRes) {

    }

    @Override
    protected BasePresenter[] initPresenters() {
        return new BasePresenter[]{realNameAuthenticationPresenter, realPresenter};
    }


    public void onClickView(View v) {
        if (checkDouble())
            return;

        int id = v.getId();
        if (id == R.id.tv_qr_get_pin) {
            if (!TextUtils.isEmpty(et_qr_phone_number.getText())) {
                String bankPhone = et_qr_phone_number.getText().toString().trim();
                name = tv_qr_name.getText().toString().trim();
                userCardId = tv_qr_id.getText().toString().trim();
                String bankCardNumber = ACache.get(this).getAsString("bankCardNumber").replace(" ", "");
                String channelId = ACache.get(this).getAsString("channelId");

                if (TextUtils.isEmpty(name)) {
                    PubUtils.popTipOrWarn(this, "请输入姓名");
                    return;
                }
                if (TextUtils.isEmpty(userCardId)) {
                    PubUtils.popTipOrWarn(this, "请输入身份证");
                    return;
                }

                realNameAuthenticationPresenter.getCheckCodeCcbReq(bankCardNumber, userCardId, et_qr_phone_number.getText().toString(), name);
            } else {
                PubUtils.popTipOrWarn(AppendRealNameInfoActivity.this, "请输入银行预留的手机号");
            }
        } else if (id == R.id.tv_qr_bind) {
            if (type == 0) {
                String bankCode = ACache.get(this).getAsString("bankCode");

                String name = tv_qr_name.getText().toString().trim();
                userCardId = tv_qr_id.getText().toString().trim();
                if (TextUtils.isEmpty(name)) {
                    PubUtils.popTipOrWarn(this, "请输入姓名");
                    return;
                }
                if (TextUtils.isEmpty(userCardId)) {
                    PubUtils.popTipOrWarn(this, "请输入身份证");
                    return;
                }
                String phoneCode = et_qr_phone_pin.getText().toString().trim();
                bankPhone = et_qr_phone_number.getText().toString().trim();
                String job = jobTxt.getText().toString().trim();
                String adress = address.getText().toString().trim();
                String minzu = mingzuTxt.getText().toString().trim();
                String start = create_card_time.getText().toString().trim();

                String startTime = start.replace("-", "");
                String end = destroy_card_time.getText().toString().trim();
                if (end.equals("长期有效")) {
                    end = "99991231";
                }
                String endTime = end.replace("-", "");

                String bankCardNumber = ACache.get(this).getAsString("bankCardNumber").trim().replace(" ", "");
//                    String bankCardNumber = "624132569632145632";
                if (TextUtils.isEmpty(startTime)) {
                    PubUtils.popTipOrWarn(this, "请选择身份证发放日期");
                    return;
                }
                if (TextUtils.isEmpty(endTime)) {
                    PubUtils.popTipOrWarn(this, "请选择身份证到期日期");
                    return;
                }
                int i = Integer.parseInt(startTime);
                j = Integer.parseInt(endTime);

                if (j < i) {
                    PubUtils.popTipOrWarn(this, "您选择的身份证日期不正确");
                    return;
                }


                if (TextUtils.isEmpty(minzu)) {
                    PubUtils.popTipOrWarn(this, "请选择民族");
                    return;
                }
                if (TextUtils.isEmpty(job)) {
                    PubUtils.popTipOrWarn(this, "请选择职业类别");
                    return;
                }
                if (TextUtils.isEmpty(adress)) {
                    PubUtils.popTipOrWarn(this, "请输入地址");
                    return;
                }
                if (TextUtils.isEmpty(phoneCode)) {
                    PubUtils.popTipOrWarn(this, "请输入验证码");
                    return;
                }

                bindBankCardId = bankCardNumber;
                realNameAuthenticationPresenter.realNameAuthentication(bankCode, name,
                        userCardId, bindBankCardId,
                        bankPhone, phoneCode, peopleCode, adress, startTime, endTime, jobCode);
                showLoadingDialog();
            } else {
                realNameAuthenticationPresenter.changeMyBankCard(bankCode, bindBankCardId,
                        et_qr_phone_number.getText().toString().trim(), et_qr_phone_pin.getText().toString().trim());
            }
        }
    }

    private void showDataDialog(final String times) {

        Calendar startDate = Calendar.getInstance();
        Calendar endDate = Calendar.getInstance();
        startDate.set(2013, 0, 1);
        endDate.set(2020, 11, 31);
        TimePickerView pvTime = new TimePickerBuilder(AppendRealNameInfoActivity.this, new OnTimeSelectListener() {
            @Override
            public void onTimeSelect(Date date, View v) {
                if (times.equals("1")) {
                    create_card_time.setText(getTime(date));
                } else {
                    destroy_card_time.setText(getTime(date));
                }
            }
        }).setCancelText("取消")
                .setSubmitText("确定")
                .isDialog(false)
                .build();
        pvTime.show();
//        TimePickerView pvTime = new TimePickerView.Builder(this, new TimePickerView.OnTimeSelectListener() {
//            @Override
//            public void onTimeSelect(Date date, View v) {
//                String time = getTime(date);
//                if (times.equals("1")){
//                    create_card_time.setText(time);
//                }else {
//                    destroy_card_time.setText(time);
//                }
//            }
//        })
//                .setType(new boolean[]{true, true, true, false, false, false})// 默认全部显示
//                .setCancelText("取消")//取消按钮文字
//                .setSubmitText("确定")//确认按钮文字
////                .setContentSize(18)//滚轮文字大小
////                .setTitleSize(20)//标题文字大小
////                //.setTitleText("Title")//标题文字
////                .setOutSideCancelable(true)//点击屏幕，点在控件外部范围时，是否取消显示
////                .isCyclic(true)//是否循环滚动
////                //.setTitleColor(Color.BLACK)//标题文字颜色
////                .setSubmitColor(Color.BLUE)//确定按钮文字颜色
////                .setCancelColor(Color.BLUE)//取消按钮文字颜色
////                //.setTitleBgColor(0xFF666666)//标题背景颜色 Night mode
////                .setBgColor(0xFF333333)//滚轮背景颜色 Night mode
//////                .setDate(selectedDate)// 如果不设置的话，默认是系统时间*/
//////                .setRangDate(startDate,endDate)//起始终止年月日设定
////                //.setLabel("年","月","日","时","分","秒")//默认设置为年月日时分秒
//                .isCenterLabel(false) //是否只显示中间选中项的label文字，false则每项item全部都带有label。
//                //.isDialog(true)//是否显示为对话框样式
//                .build();
//
//        pvTime.show();
    }

    private String getTime(Date date) {//可根据需要自行截取数据显示
        Log.d("getTime()", "choice date millis: " + date.getTime());
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        return format.format(date);
    }

    private long time = 0;

    private boolean checkDouble() {
        if (System.currentTimeMillis() - time < 1500) {
            time = System.currentTimeMillis();
            return true;
        } else {
            time = System.currentTimeMillis();
            return false;
        }
    }

    @Override
    public void onAuthenticationSuccess() {
        dismissLoadingDialog();
        PreAuthResult preAuthResult = GlobalVariables.getInstance(this).getPreAuthResult();
        preAuthResult.setUserStatus(Constant.QUERY_QR_RESULT_NO_PAY_PWD_SET);
        GlobalVariables.getInstance(this).setPreAuthResult(this, preAuthResult);
        openSucc();
    }

    private void openSucc() {
        CantCloseDialog cantCloseDialog = new CantCloseDialog();
        cantCloseDialog.setAction(1);
        cantCloseDialog.show(this.getFragmentManager(), null);
    }

    @Override
    public void onAuthenticationSuccess(AuthenticationResp authenticationResp) {
        dismissLoadingDialog();

        if ("0000".equals(authenticationResp.getCode())) {
            PreAuthResult preAuthResult = GlobalVariables.getInstance(this).getPreAuthResult();
            preAuthResult.setUserStatus(Constant.QUERY_QR_RESULT_NO_PAY_PWD_SET);
            GlobalVariables.getInstance(this).setPreAuthResult(this, preAuthResult);
            openSucc();
        } else if ("0046".equals(authenticationResp.getCode())) {
            ChooseCardDialog dialog = new ChooseCardDialog(AppendRealNameInfoActivity.this);
            dialog.setOldBankNo(authenticationResp.getOldBankNo());
            dialog.setNewBankNo(authenticationResp.getnBankNo());
            dialog.setOnBindCardCheckListener(new ChooseCardDialog.OnBindCardCheckListener() {
                @Override
                public void onBindCheck(int type) {
                    showLoadingDialog();
                    realNameAuthenticationPresenter.oldUserCheck(type);
                }
            });
            dialog.show();
        }
    }

    @Override
    public void onChangeBankCard() {
        showResult(true, "");
    }

    @Override
    public void onAuthenticationFail(String message) {
//        Toast.makeText(instance, "", Toast.LENGTH_SHORT).show();
        dismissLoadingDialog();
        showResult(false, message);
    }

    private PopupWindow popupWindow;

    private void showResult(final boolean success, String message) {
        View popView = getLayoutInflater().inflate(R.layout.qr_pop_authentication_result, null);
        TextView tv_qr_ok = (TextView) popView.findViewById(R.id.tv_qr_ok);
        ImageView iv_qr_authentication_status = (ImageView) popView.findViewById(R.id.iv_qr_authentication_status);
        TextView tv_qr_authentication_message = (TextView) popView.findViewById(R.id.tv_qr_authentication_message);
        if (success) {
            iv_qr_authentication_status.setImageResource(R.drawable.qr_authentication_successful);
            tv_qr_authentication_message.setText("更换／绑卡成功");
        } else {
            iv_qr_authentication_status.setImageResource(R.drawable.qr_authentication_failed);
            tv_qr_authentication_message.setText(message);
        }
        popupWindow = new PopupWindow(popView,
                ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, true);//popView即popupWindow的布局，ture设置focusAble.

        //必须设置BackgroundDrawable后setOutsideTouchable(true)才会有效。这里在XML中定义背景，所以这里设置为null;
//        popupWindow.setBackgroundDrawable(new BitmapDrawable(getResources(), (Bitmap) null));
//        popupWindow.setOutsideTouchable(false); //点击外部关闭。
        popupWindow.setAnimationStyle(android.R.style.Animation_Dialog);    //设置一个动画。
        backgroundAlpha(0.5f);
        popupWindow.showAtLocation(findViewById(R.id.ll_qr_bind_bank), Gravity.CENTER, 0, 0);
        tv_qr_ok.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                popupWindow.dismiss();
                if (success) {
                    setResult(456);
                    eventBus.post(new MessageEvent(MessageEvent.CODE_BIND_BANK_CARD_SUCCESS));
                    finish();
                } else {
//                    finish();
                }
            }
        });
        popupWindow.setOnDismissListener(new poponDismissListener());
    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        if (id == R.id.create_ll) {
            showDataDialog("1");
            StringUtils.hideInput(this);
        } else if (id == R.id.destroy_ll) {
            showMyDialog();
        } else if (id == R.id.job_ll) {
            realNameAuthenticationPresenter.getJob();
        } else if (id == R.id.minzu_ll) {
            realNameAuthenticationPresenter.getPeople();
        }
    }

    class poponDismissListener implements PopupWindow.OnDismissListener {

        @Override
        public void onDismiss() {
            //Log.v("List_noteTypeActivity:", "我是关闭事件");
            backgroundAlpha(1f);
        }
    }


    private void backgroundAlpha(float bgAlpha) {
        WindowManager.LayoutParams lp = getWindow().getAttributes();
        lp.alpha = bgAlpha; //0.0-1.0
        getWindow().setAttributes(lp);
    }

    private void showMyDialog() {
        dialog = new Dialog(this, R.style.ActionSheetDialogStyle);
        inflate = LayoutInflater.from(this).inflate(R.layout.dialog_ic_card, null);
        //初始化控件
        getPhoneCamera = (TextView) findViewById(R.id.upload_phone_camera);
        getPhoneAlbnm = (TextView) findViewById(R.id.upload_phone_albnm);

//        choosePhoto.setOnClickListener(this);
        //将布局设置给Dialog
        dialog.setContentView(inflate);
        //获取当前Activity所在的窗体
        Window dialogWindow = dialog.getWindow();
        dialogWindow.findViewById(R.id.upload_phone_albnm).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.cancel();
                showDataDialog("0");
            }
        });
        dialogWindow.findViewById(R.id.upload_phone_camera).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.cancel();
                destroy_card_time.setText("长期有效");

            }


        });
        dialogWindow.findViewById(R.id.upload_sure).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
            }
        });
        //设置Dialog从窗体底部弹出
        dialogWindow.setGravity(Gravity.BOTTOM);
        //获得窗体的属性
        WindowManager.LayoutParams lp = dialogWindow.getAttributes();
        lp.y = 20;//设置Dialog距离底部的距离
//       将属性设置给窗体
        dialogWindow.setAttributes(lp);
        dialog.show();//显示对话框
    }


    @Override
    public void onGetCheckCode() {
        smsTimer.start();
    }

    @Override
    public void onGetCheckCodeFail(BaseRes baseRes) {
        Toast.makeText(instance, baseRes.getMessage(), Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onGetBankName(Bank bank) {
//        tv_qr_bank_name.setText(bank.getBankName() + "");
        bankCode = bank.getBankCode();
    }

    @Override
    public void onGetBankNamefail() {

    }

    @Override
    public void onGetPeopleSucc(List<GetPeopleRes.DataBean> data) {

        peopleList.clear();
        peopleList.addAll(data);
        showItemDialog(SHOW_LIST_PEOPLE);
    }

    @Override
    public void onGetPeopleFail() {

    }

    @Override
    public void onGetJobSucc(List<GetJobRes.DataBean> data) {

        jobList.clear();
        jobList.addAll(data);
        showItemDialog(SHOW_LIST_JOB);
    }

    @Override
    public void onGetJobFail() {

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ACache.get(this).remove("bankCardNumber");
    }

    @Override
    protected CharSequence getTopTitle() {
        Intent intent = getIntent();
//        type = intent.getIntExtra("type", 0);
////        name = intent.getStringExtra("name");
////        iccard = intent.getStringExtra("iccard");
//        if (type == 0) {
//            return getString(R.string.qr_bind_bank_card);
//        } else {
        return "完善身份信息";
//        }
    }


    /**
     * 展示银行选择的dialog
     *
     * @param type
     */
    private void showItemDialog(final int type) {
        itemListDialog = new BottomSheetDialog(this);
        RecyclerView bankRecycler = new RecyclerView(AppendRealNameInfoActivity.this);
        bankRecycler.setLayoutManager(new LinearLayoutManager(this));
        bankRecycler.setAdapter(new RecyclerView.Adapter<ItemHolder>() {
            @Override
            public ItemHolder onCreateViewHolder(ViewGroup parent, int viewType) {
                return new ItemHolder(LayoutInflater.from(AppendRealNameInfoActivity.this).inflate(R.layout.item_text_list, parent, false));
            }

            @Override
            public void onBindViewHolder(ItemHolder holder, @SuppressLint("RecyclerView") final int position) {
                if (type == SHOW_LIST_JOB) {
                    holder.itemName.setText(jobList.get(position).getJobName());
                    holder.root.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View view) {
                            currentJob = jobList.get(position);
                            jobCode = jobList.get(position).getJobCode();
                            jobTxt.setText(currentJob.getJobName());
                            itemListDialog.dismiss();
                        }
                    });
                } else {
                    holder.itemName.setText(peopleList.get(position).getPeopleName());
                    holder.root.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View view) {
                            currentPeople = peopleList.get(position);
                            peopleCode = currentPeople.getPeopleCode();
                            mingzuTxt.setText(currentPeople.getPeopleName());
                            itemListDialog.dismiss();
                        }
                    });
                }
            }

            @Override
            public int getItemCount() {
                if (type == SHOW_LIST_JOB)
                    return jobList == null ? 0 : jobList.size();
                else
                    return peopleList == null ? 0 : peopleList.size();

            }
        });
        itemListDialog.setContentView(bankRecycler);
        itemListDialog.show();
    }

    /**
     * 文本holder
     */
    class ItemHolder extends RecyclerView.ViewHolder {

        View root;
        TextView itemName;

        public ItemHolder(View itemView) {
            super(itemView);
            root = itemView;
            itemName = (TextView) root.findViewById(R.id.item_name);
        }
    }

    public void initView(){
        tv_qr_name = findViewById(R.id.tv_qr_name);
        tv_qr_id= findViewById(R.id.tv_qr_id);

        et_qr_phone_number= findViewById(R.id.et_qr_phone_number);

        create_card_time= findViewById(R.id.create_card_time);
        destroy_card_time= findViewById(R.id.destroy_card_time);

        mingzuTxt= findViewById(R.id.mingzu);
        jobTxt= findViewById(R.id.job);

        address= findViewById(R.id.address);

        et_qr_phone_pin= findViewById(R.id.et_qr_phone_pin);
        tv_qr_get_pin= findViewById(R.id.tv_qr_get_pin);

        createLl= findViewById(R.id.create_ll);
        destroyLl= findViewById(R.id.destroy_ll);
        minzuLl= findViewById(R.id.minzu_ll);
        jobLl= findViewById(R.id.job_ll);
        nameRl= findViewById(R.id.name_rl);
        idRl= findViewById(R.id.id_rl);






    }
}
